package com.lineage.data.item_etcitem.add;

import com.lineage.data.executor.ItemExecutor;
import com.lineage.server.model.Instance.L1ItemInstance;
import com.lineage.server.model.Instance.L1PcInstance;
import com.lineage.server.serverpackets.S_ServerMessage;
import com.lineage.server.serverpackets.S_SystemMessage;
import com.lineage.server.serverpackets.ServerBasePacket;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class clan_glass extends ItemExecutor {
  private int a;
  
  private static final Log _log = LogFactory.getLog(clan_glass.class);
  
  public static ItemExecutor get() {
    return new clan_glass();
  }
  
  public void execute(int[] data, L1PcInstance pc, L1ItemInstance item) {
    if (pc.getClanid() == 0) {
      pc.sendPackets((ServerBasePacket)new S_ServerMessage("\\fY您尚未加入血盟无法使用"));
      return;
    } 
    pc.setPcContribution(pc.getPcContribution() + this.a);
    pc.sendPackets((ServerBasePacket)new S_SystemMessage("获得" + this.a + "点血盟能量值。"));
    pc.getInventory().removeItem(item, 1L);
  }
  
  public void set_set(String[] set) {
    this.a = Integer.parseInt(set[1]);
  }
}
